const formatTime = date => {
  const year = date.getFullYear()
  const month = date.getMonth() + 1
  const day = date.getDate()
  const hour = date.getHours()
  const minute = date.getMinutes()
  const second = date.getSeconds()

  return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
}

const user = {
  "id": "1",
  "userName": "656",
  "userPhone": "18623412312",
  "isMember": false,
}

const indexSwiperList = [{
    image: "/pages/images/908fa0ec08fa513d269746abc43e42fbb2fb43167330.jpg"
  },
  {
    image: "/pages/images/u=732240270,612398480&fm=253&fmt=auto&app=120&f=JPEG.webp"
  },
  {
    image: "/pages/images/0066gC6bgy1ht4rimkn0bj30m80m8gpg.jpg"
  },
]

const indexDataList = [{
    "id": "1",
    "category": "JAVA课程",
    "goodsList": [{
        "id": "1",
        "title": "java集训课",
        "url": "/pages/images/0066gC6bgy1ht4rimkn0bj30m80m8gpg.jpg",
        "price": "10.00",
        "desc": "一个月小白变成老白,看到就是赚到",
      },
      {
        "id": "2",
        "title": "java应用",
        "url": "/pages/images/u=732240270,612398480&fm=253&fmt=auto&app=120&f=JPEG.webp",
        "price": "20.00",
        "desc": "带你走进企业项目",
      },
    ]
  },
  {
    "id": "2",
    "category": "C#课程",
    "goodsList": [{
        "id": "3",
        "title": "C#集训课",
        "url": "/pages/images/0066gC6bgy1ht4rimkn0bj30m80m8gpg.jpg",
        "price": "10.00",
        "desc": "一个月小白变成老白,看到就是赚到",
      },
      {
        "id": "4",
        "title": "C#应用",
        "url": "/pages/images/0066gC6bgy1ht4rimkn0bj30m80m8gpg.jpg",
        "price": "20.00",
        "desc": "一个月小白变成老白,看到就是赚到",
      },
    ]
  }
]

const formatNumber = n => {
  n = n.toString()
  return n[1] ? n : `0${n}`
}

// const playDataList = [{
//     "id": "1",
//     "title": "概述",
//     "contentList": [{
//         "id": "1",
//         "url": "http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400",
//         "describe": "java创始人",
//         "showTail": true,
//       },
//       {
//         "id": "2",
//         "url": "http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400",
//         "describe": "java用途",
//         "showTail": false,
//       }
//     ]
//   },
//   {
//     "id": "2",
//     "title": "算法",
//     "contentList": [{
//       "id": "3",
//       "url": "http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400",
//       "describe": "冒泡排序",
//       "showTail": false,
//     }]
//   },
// ]

const playData = {
  "id": "1",
  "title": "java集训课",
  "url": "/pages/images/0066gC6bgy1ht4rimkn0bj30m80m8gpg.jpg",
  "price": "10.00",
  "desc": "一个月小白变成老白,看到就是赚到",
  "videoList": [{
      "id": "1",
      "title": "概述",
      "contentList": [{
          "id": "1",
          "url": "http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400",
          "describe": "java创始人",
          "showTail": true,
        },
        {
          "id": "2",
          "url": "http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400",
          "describe": "java用途",
          "showTail": false,
        }
      ]
    },
    {
      "id": "2",
      "title": "算法",
      "contentList": [{
        "id": "3",
        "url": "http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400",
        "describe": "冒泡排序",
        "showTail": false,
      }]
    }
  ]
}

const historyList = ["JAVA", "C#"]

const hotKeywords = [{
    text: "JAVA"
  },
  {
    text: "C#"
  },
  {
    text: "C++"
  },
  {
    text: "python"
  },
  {
    text: "JavaScript"
  },
  {
    text: "HTML"
  },
]

const goodsList = [{
    "id": "1",
    "title": "java集训课",
    "url": "/pages/images/0066gC6bgy1ht4rimkn0bj30m80m8gpg.jpg",
    "price": "10.00",
    "desc": "一个月小白变成老白,看到就是赚到",
  },
  {
    "id": "2",
    "title": "java应用",
    "url": "/pages/images/u=732240270,612398480&fm=253&fmt=auto&app=120&f=JPEG.webp",
    "price": "20.00",
    "desc": "带你走进企业项目",
  },
]

module.exports = {
  formatTime,
  indexSwiperList,
  indexDataList,
  user,
  playData,
  historyList,
  hotKeywords,
  goodsList
}